﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    AddChannel
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Добавить канал</h2>

 <%: Html.ValidationSummary("Не все поля были заполнены верно") %>

<% using (Html.BeginForm()) { %>
   
    <fieldset>
        <legend>Данные</legend>

        <script type="text/javascript">
            $(document).ready(function () {
                $('.autocomplete').autocomplete("/home/GetSites", {
                    delay: 10,
                    minChars: 1,
                    matchSubset: 1,
                    matchContains: 1,
                    cacheLength: 10,
                    selectFirst: true,
                    maxItemsToShow: 10
                });
            });
        </script>
        <p>
            <label for="channelName">Название:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
            &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
            </label> <label for="visible">Доступен всем:</label><br />
            <%: Html.TextBox("channelName") %>
            <%: Html.ValidationMessage("channelName","*") %>
            
            <%: Html.CheckBox("visible", "true")%>
        </p>
        <p>
            <label for="siteName1">Сайт 1:</label><br />
                <input type="text" name="siteName1" class="autocomplete" />
                <%: Html.ValidationMessage("channelName","*") %><br />
            <label for="siteName2">Сайт 2:</label><br />
                <input type="text" name="siteName2" class="autocomplete" /><br />
            <label for="siteName3">Сайт 3:</label><br />
                <input type="text" name="siteName3" class="autocomplete" />
        </p>
        <p>
            <label for="tags">Теги (Например: Новости, музыка)</label><br />
                <%: Html.TextBox("Tags")%>
                <%: Html.ValidationMessage("tags","*") %>
        </p>
        <p>
            <label for="description">Описание:</label><br />
                <%: Html.TextArea("description") %>
                <%: Html.ValidationMessage("description","*") %>
        </p>

        <p>
            <input type="submit" value="Добавить" />
        </p>
    </fieldset>
<% } %>

<div>
    <%: Html.ActionLink("Назад", "Index") %>
</div>

   
</asp:Content>
